var JS_DETAIL = function () {
    var owner = this;
    owner.currentId = null;
    owner.dom_tag = "detail";
    owner.dom_edit = $("#" + owner.dom_tag + "_div");

    owner.init = function () {
        owner.currentId = request("id");
        if(owner.currentId!=null) {
            owner.loadEmployee(owner.currentId);
        }
    };

    owner.loadEmployee = function (id) {
        owner.dom_loading.window("open").window("center");
        $.ajax({
            type: "get",
            url: "/employ/get",
            cache: false,
            dataType: "json",
            data: {
                "id": id
            }
        }).done(function (result) {
            if (result.success) {
                owner.resetEdit(result.data);
            } else {
                $.messager.alert("提示信息", result.message);
            }
        }).fail(function () {
            $.messager.alert("提示信息", "网络繁忙，请稍后再试！");
        }).complete(function () {
            owner.dom_loading.window("close");
        });
    };

    owner.resetEdit = function (item) {
        $("#" + owner.dom_tag + "_ipt_name").html(item.name);
        $("#" + owner.dom_tag + "_ipt_gender").combobox("setValue", item.gender);
        $("#" + owner.dom_tag + "_ipt_age").numberspinner("setValue", item.age);
        $("#" + owner.dom_tag + "_ipt_workAge").numberspinner("setValue", item.workAge);
        $("#" + owner.dom_tag + "_ipt_phone").textbox("setValue", item.phone);
        $("#" + owner.dom_tag + "_ipt_mail").textbox("setValue", item.mail);
        $("#" + owner.dom_tag + "_ipt_getType").combobox("setValue", item.pipe);
        $("#" + owner.dom_tag + "_ipt_referee").combobox("setValue", item.referee);
        $("#" + owner.dom_tag + "_ipt_sender").textbox("setValue", item.sender);
        $("#" + owner.dom_tag + "_ipt_tip").tagbox("setValue", item.tips);
        $("#" + owner.dom_tag + "_ipt_job").combobox("setValue", item.jobId);
        $("#" + owner.dom_tag + "_ipt_inviteStatus").combobox("setValue", item.inviteStatus);
        $("#" + owner.dom_tag + "_ipt_interviewStatus").combobox("setValue", item.interviewStatus);
        $("#" + owner.dom_tag + "_ipt_interviewTime").val(item.interviewTime);
        $("#" + owner.dom_tag + "_ipt_interviewType").combobox("setValue", item.interviewType);
        $("#" + owner.dom_tag + "_ipt_interviewer1").combobox("setValue", item.interviewer1);
        $("#" + owner.dom_tag + "_ipt_interviewer2").combobox("setValue", item.interviewer2);
        $("#" + owner.dom_tag + "_ipt_interviewer0").combobox("setValue", item.interviewer0);
        $("#" + owner.dom_tag + "_ipt_file").combobox("setValue", item.interviewer0);
    };


};